1. Field of the Invention
The present invention relates to a method, a computer program product, and a device for operating a computer memory.
2. Description of Related Art
Solid-state memory devices encompass rewritable non-volatile memory devices which may use electronic circuitry for storing data. Currently, solid-state memory devices start replacing conventional storage devices such as hard disk drives and optical disk drives in some arenas, such as in mass storage applications for laptops or desktops. Solid state memory devices are also investigated for replacing conventional storage devices in other areas such as in enterprise storage systems. This is because solid state memory devices offer exceptional bandwidth as well as excellent random I/O (input/output) performance along with an appreciated robustness due to lack of moveable parts.
However, writing data to a solid-state memory device such as a flash memory device requires paying attention to specifics in the flash technology: NAND Flash memory is organized in units of pages and blocks. Multiple pages form a block. While read and write operations can be applied to individual pages, erase operations can only be applied to entire blocks. And while in other storage technologies outdated data can simply be overwritten by new data, Flash technology requires an erase operation before new data can be written to an erased block.
Another specific in Flash technology is that today's Flash memory devices are limited to a finite number of Program Erase (PE) cycles. A Flash memory device typically has an endurance specification that defines its maximum number of PE cycles. Therefore, a writing technique is applied called “write out of place” in which new or updated data is written to some free page offered by a free page allocator instead of writing it to the same page where the out-dated data resides. The page containing the out-dated data is marked as invalid page. By such means, the life expectancy of Flash-based solid-state drives (SSD) and also log-structured file systems may be extended, since erase cycles needed for directly overwriting data in a block are avoided.
However, available free pages may be exhausted over time. Instead, the blocks of the Flash memory device may be occupied by a mix of valid and invalid pages. New free space needs to be created by a block reclaiming process, also denoted as garbage-collection process, which reclaims space occupied by out-dated, i.e. invalid, data. A block reclaiming process first identifies blocks for erasing based on a given policy. Then, valid data residing in such blocks is copied (relocated) to other blocks containing free pages, and finally the subject blocks are erased so that they become available for rewriting.
The block reclaiming mechanism introduces additional read and write operations the extent of which depends on the specific policy deployed as well as on the system parameters. Such additional writes are also referred to as “write amplification” phenomenon. The write amplification negatively affects the lifetime and endurance of SSDs since it produces data elsewhere which need to be erased sooner or later again, and it slows down the overall performance of the Flash memory device.
A Flash memory device may even stop operating when only a small fraction of its blocks are worn out. In this case, there may still be blocks that are either unused or underused. Wear-leveling algorithms ensure that erasures are distributed more evenly across the Flash memory blocks.